<template>
  <div class="form-containter">
    <el-tabs type="border-card">
      <div>
        <p class="content-tit">调拨申请</p>
        <el-form :label-position="labelPosition" label-width="100px" :model="formData">
          <el-row type="flex" class="row-bg">
            <el-col :span="8">
              <el-form-item label="单证编码" size="mini":required="true">
                <el-select v-model="formData.certifyEdition" filterable placeholder="请选择">
                  <el-option
                    v-for="item in certifyTypeList"
                    :key="item.code"
                    :label="item.codeName"
                    :value="item.code">
                    <span>{{ item.code }}</span> - <span>{{ item.codeName }}</span>
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="单证名称" size="mini":required="true">
                <el-input v-model="formData.certifyName"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row type="flex" class="row-bg">
            <el-col :span="8">
              <el-form-item label="单证版本" size="mini":required="true">
                <el-select v-model="formData.certifyEdition" clearable filterable placeholder="请选择">
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="调拨申请数量" size="mini":required="true">
                <el-input v-model="formData.allotApplyNo"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>
        <div align="right">
          <el-button type="primary" icon="el-icon-plus">
            添加
          </el-button>
          <el-button type="danger" @click="deleted" icon="el-icon-delete">删除</el-button>
        </div>
      </div>
      <div>
        <p class="content-tit">
          <span @click="isShow('isShowSingles')" v-if='isShowSingles'>-</span>
          <span @click="isShow('isShowSingles')" v-else>+</span>调拨申请列表</p>
        <el-table :data="certifyCountList" style="width: 100%" class='table-common' :highlight-current-row="true" border
                  v-show="isShowSingles">
          <el-table-column label="#" checked="selectionData"
                           type="selection"
                           min-width="6%">
          </el-table-column>
          <el-table-column label="序号" type='index' min-width="8%" align="center"></el-table-column>
          <el-table-column prop="dicTypeId" label="单证编码" min-width="10%" align="center"></el-table-column>
          <el-table-column prop="TypeDis" label="单证名称" min-width="15%" align="center"></el-table-column>
          <el-table-column prop="certifyEdition" label="单证版本" min-width="9%" align="center"></el-table-column>
          <el-table-column label="调拨申请数量" min-width="10%" align="center"></el-table-column>
          <el-table-column label="调拨审批结论" min-width="10%" align="center"></el-table-column>
        </el-table>
        <div class="mar15 " align="right" v-show="isShowSingles">
          <el-pagination
            @current-change="handleCurrentChangeSingle"
            :current-page="selfPage.currentPage"
            :page-size="selfPage.perPage"
            layout="total, prev, pager, next, jumper"
            :total="selfPage.totalSize">
          </el-pagination>
        </div>
      </div>
      <div>
        <p class="content-tit">调拨申请信息</p>
        <el-form :label-position="labelPosition" label-width="100px" :model="formData1">
          <el-row type="flex" class="row-bg">
            <el-col :span="8">
              <el-form-item label="申请调入机构" size="mini":required="true">
                <el-select v-model="formData.code2" clearable filterable placeholder="86-总部">
                  <el-option value="86-总部"></el-option>
                  <el-option value="8601-分公司"></el-option>
                  <el-option value="860101-支公司"></el-option>
                  <el-option value="86010101-营销部"></el-option>
                </el-select>
              </el-form-item>
            </el-col>

            <el-col :span="8">
              <el-form-item label="操作员" size="mini":required="true">
                <el-input v-model="formData1.operator"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="申请日期" size="mini":required="true">
                <el-date-picker type="date" v-model="formData1.applyDate" placeholder="选择时间" :value-format="'yyyy-MM-dd'"
                                :format="'yyyy-MM-dd'"></el-date-picker>
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>
      </div>
      <div align="right">
        <el-button type="primary" @click="">调拨申请</el-button>
      </div>
    </el-tabs>
  </div>
</template>

<script>
  export default {
    name: "card-allot-apply",
    data() {
      return {
        isShowSingles: true,
        labelPosition: 'right',
        formData: {
          certifyEdition: "",
          certifyCode: '',
          certifyName: '',
          allotApplyNo: ''
        },
        formData1: {
          applyReceiveCom: '',
          operator: '',
          applyDate: ''
        },
        selfPage: {
          currentPage: 1,
          hasMore: true,
          perPage: 10,
          totalPage: 0,
          totalSize: 0
        },
        certifyCountList: []
      }
    },
    methods: {
      isShow(val) {
        this[val] = !this[val]
      },
      handleSelectionChange(val) {
        this.selectionData = val;
      },
      handleCurrentChange(num) {
        this.selfFormData.pageNum = num
      },
      handleCurrentChangeSingle(num) {
        this.selfFormData.pageNum = num
      },
    }
  }
</script>

<style scoped>

</style>
